#!/bin/bash

# 开始下载
URL=https://openresty.org/download/openresty-1.15.8.2.tar.gz
source ../../linux/download_unzip.sh "openresty" $URL

#============== 调用本脚本时可用变量 ==============
#>>> $FILE_PATH 文件绝对路径：/opt/software/openresty-1.15.8.2.tar.gz
#>>> $FILE_EXTENSION 文件后缀：gz
#>>> $File_HOME 软件HOME：/opt/module/openresty/openresty-1.15.8.2
#>>> $REPO_PATH 仓库目录：/opt/repository/openresty

yum install -y gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel

cd $File_HOME
./configure --prefix=/opt/module/openresty/server

make && make install

# (8)在conf目录下的nginx.conf添加如下内容
# location /lua{
#     default_type 'text/html';
#     content_by_lua 'ngx.say("
#     <h1>HELLO,OpenRestry</h1>")';
# }
# (9)在sbin目录下启动nginx
# (10)通过浏览器访问测试 http://192.168.56.106/lua